<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>欢迎页面-X-admin2.0</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/ringspace-web/manager/css/font.css">
<link rel="stylesheet" href="/ringspace-web/manager/css/xadmin.css">
<script type="text/javascript"
	src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript"
	src="/ringspace-web/manager/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/ringspace-web/manager/js/xadmin.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
	<div class="x-nav">
		<span class="layui-breadcrumb"> <a href="">首页</a> <a href="">演示</a>
			<a> <cite>导航元素</cite></a>
		</span> <a class="layui-btn layui-btn-small"
			style="line-height: 1.6em; margin-top: 3px; float: right"
			href="javascript:location.replace(location.href);" title="刷新"> <i
			class="layui-icon" style="line-height: 30px">ဂ</i></a>
	</div>
	<div class="x-body">

		<xblock>
		<button class="layui-btn"
			onclick="x_admin_show('添加用户','./addsite.html')">
			<i class="layui-icon"></i>添加
		</button>

		</xblock>
		<table class="layui-table"
			lay-data="{url:'/ringspace-web/tsite/selectTSite',page:true,limit:'5'}"
			lay-filter="demo">
			<thead>
				<tr>
					<th lay-data="{ field:'siteId',width:200}">分站ID</th>
					<th lay-data="{ field:'siteName',width:200}">分站名称</th>
					<th lay-data="{ field:'siteProniace',width:200}">所属省份</th>
					<th lay-data="{ field:'siteCity',width:200}">所属城市</th>
					<th lay-data="{ field:'siteLinkman',width:300}">联系人</th>
					<th lay-data="{ field:'sitePhone',width:300}">联系方式</th>
					<th
						lay-data="{fixed: 'right', width:250, align:'center', toolbar: '#barDemo'}">操作</th>
				</tr>
			</thead>
		</table>
	</div>

	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<!-- <a href="" class="layui-btn layui-btn-mini" lay-event="edit">编辑</a>
    <a href="" class="layui-btn layui-btn-danger layui-btn-mini" lay-event="del">删除</a> -->
	<script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-mini" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-mini" lay-event="del">删除</a>
   </script>
	<script src="/ringspace-web/manager/lib/layui/layui.js" charset="utf-8"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
		layui
				.use(
						'table',
						function() {
							var table = layui.table;
							//监听表格复选框选择
							table.on('checkbox(demo)', function(obj) {
								console.log(obj)
							});
							//监听工具条
							table
									.on(
											'tool(demo)',
											function(obj) {
												var data = obj.data;
												if (obj.event === 'detail') {
													layer.msg('ID：' + data.id
															+ ' 的查看操作');
												} else if (obj.event === 'del') {
													layer
															.confirm(
																	'真的删除行么',
																	function(
																			index) {
																		obj
																				.del();
																		window.location.href = "/ringspace-web/tsite/deletesite?siteId="
																				+ data.siteId;
																		layer
																				.close(index);
																	});
												} else if (obj.event === 'edit') {
													window.location.href = "/ringspace-web/tsite/selectsite?siteId="
															+ data.siteId;

												}
											});

							var $ = layui.$, active = {
								getCheckData : function() { //获取选中数据
									var checkStatus = table
											.checkStatus('idTest'), data = checkStatus.data;
									layer.alert(JSON.stringify(data));
								},
								getCheckLength : function() { //获取选中数目
									var checkStatus = table
											.checkStatus('idTest'), data = checkStatus.data;
									layer.msg('选中了：' + data.length + ' 个');
								},
								isAll : function() { //验证是否全选
									var checkStatus = table
											.checkStatus('idTest');
									layer.msg(checkStatus.isAll ? '全选' : '未全选')
								}
							};

							$('.demoTable .layui-btn').on('click', function() {
								var type = $(this).data('type');
								active[type] ? active[type].call(this) : '';
							});
						});
	</script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
		layui.use('table', function() {
			var table = layui.table;

		});

		layui.use([ 'laypage', 'layer' ], function() {
			var laypage = layui.laypage, layer = layui.layer;

			//完整功能
			laypage.render({
				elem : 'demo7',
				count : 100,
				layout : [ 'count', 'prev', 'page', 'next', 'limit', 'skip' ],
				jump : function(obj) {
					console.log(obj)
				}
			});

		});
	</script>
	<script>
		layui.use('laydate', function() {
			var laydate = layui.laydate;

			//执行一个laydate实例
			laydate.render({
				elem : '#start' //指定元素
			});

			//执行一个laydate实例
			laydate.render({
				elem : '#end' //指定元素
			});
		});
	</script>
</body>